(function($j){
	var ngin_weather = window.ngin_weather = function(){};
	
	// function to get the list of events (including details)
	ngin_weather.getEvents = function(){
		return $j.get(""); 
	}
	
	// function to get the correct event from the list of events based on the date
	ngin_weather.getNextEvent = function(events){
		var now = new Date();
		return getDefaultEvent(now);
	}
	
	// create a default date item
	ngin_weather.getDefaultEvent = function(today){
		return {
			"title" : "No Event Scheduled",
			"date": today.getDate(),
			"month": today.getMonth(),
			"year": today.getFullYear(),
			"hours": today.getHours(),
			"min" : today.getMinutes(),
			"address" : "",
			"zipcode" : 55033,
			"state" : "MN"
		};
	}
	
	// function to get the lat/long based on the address of the event (using geocoder.us)
	ngin_weather.getLatLong = function(event){
		var pwd = "8bfuCZaE";
		var uname = "tdnordine";
		
		return $j.get("http://"+uname+":"+pwd+"@geocoder.us/member/service/csv/geocode?address=" + event.address + "," + event.state + "+," + event.zipcode);
	}
	
	// function to get the sunrise/sunset information for the date (using earthtools.org)
	ngin_weather.getSunInfo = function(event){
		return $j.get("");
	}
	
	
	// function to get forcast information (using weatherbug.com)
	ngin_weather.getForcast = function(event){
		return $j.get("");
	}
	
	
	// function to create the html layout
	ngin_weather.createLayout = function(event){
	}
	
	
	// function to update controls when information is all gathered successfully
	ngin_weather.update = function(event){
	}
	
	// 
})($j);


$j(function(){
	
	var res = ngin_weather.getLatLong(ngin_weather.getNextEvent(null));
	var x = res;
});
